<?php				
	interface invoice_class_info
	{		
		function getInvoiceList($InvcNo,$SuppID,$SuppName,$FromDate,$ToDate,$Description);
	}
	
	class invoice_class implements invoice_class_info
	{
		function invoice_class()
		{
			@session_start(); 
			require_once('../../lib/'.'BaseDir.inc.htm');
			require_once(EIU_LIB.'DBCommon.class.htm');					
		}
			
		function getInvoiceList($InvcNo,$SuppID,$SuppName,$FromDate,$ToDate,$Description)
		{
			$oDB = new DBCommon();
			$conn =  $oDB->stl_openConn();
									
			$q = "
				SELECT InvcID,InvcNo,SuppID,SuppName,InvcDate,Description
				FROM invoice_tbl 
				WHERE 
					InvcNo LIKE '%".$InvcNo."%' AND 
					SuppID LIKE '%".$SuppID."%' AND 
					SuppName LIKE '%".$SuppName."%' AND 
					Description LIKE '%".$Remark."%' AND
					InvcDate BETWEEN '".$FromDate."' AND '".$ToDate."' AND
					isDeleted=0 ORDER BY `InvcNo` ASC
			";
			echo $q;
			$rs = $oDB->stl_db_select($q, $conn);
			
			$oDB->stl_closeConn($conn);
			
			if($rs)	return $rs;
			else return false;			
			
		}	
		
		function getInvoiceIDList($InvcCode)
		{
			$oDB = new DBCommon();
			$conn =  $oDB->stl_openConn();
									
			$q = "
				SELECT `InvcID`
				FROM invoice_tbl 
				WHERE 
					InvcNo LIKE '%".$InvcCode."%' AND 					
					isDeleted=0 ORDER BY `InvcNo` ASC
			";
			//echo $q;
			$rs = $oDB->stl_db_select($q, $conn);
			
			$oDB->stl_closeConn($conn);
			
			if($rs)	return $rs;
			else return false;	
		}
	}
?>